# Contributor: Rasmus Thomsen <oss@cogitri.dev>
# Maintainer: Rasmus Thomsen <oss@cogitri.dev>
pkgname=fractal
pkgver=4.2.2
pkgrel=4
pkgdesc="Matrix group messaging app"
url="https://wiki.gnome.org/Apps/Fractal"
arch="x86_64 x86 armhf armv7 aarch64 ppc64le" # limited by Rust
license="GPL-3.0-or-later"
depends="dbus:org.freedesktop.Secrets xdg-utils"
makedepends="meson gtk+3.0-dev dbus-dev openssl-dev gspell-dev libhandy-dev
	gtksourceview4-dev gstreamer-dev gst-plugins-base-dev gst-plugins-bad-dev
	gst-editing-services-dev glib-dev cargo gmp-dev"
options="!check" # no tests
subpackages="$pkgname-lang"
source="https://gitlab.gnome.org/GNOME/fractal/-/archive/$pkgver/fractal-$pkgver.tar.gz"

case "$CARCH" in
	x86)
		export CFLAGS="$CFLAGS -fno-stack-protector"
		;;
esac

build() {
	meson \
		--prefix=/usr \
		--sysconfdir=/etc \
		--mandir=/usr/share/man \
		--localstatedir=/var \
		--buildtype=plain \
		. output
	ninja -C output
}

package() {
	DESTDIR="$pkgdir" ninja -C output install
}

sha512sums="29077293d601cab80cb26e960b374557950cfc0d123dab4cf52ea008e88d5c456cc4d0596fee4d649ec69bbc4381f1857b5ce1bee31e82f8af05efee4f7c2226  fractal-4.2.2.tar.gz"
